package com.atguigu.yygh.hosp.controller;

import com.atguigu.yygh.common.result.Result;
import com.atguigu.yygh.hosp.service.DepartmentService;
import com.atguigu.yygh.param.hosp.DepartmentVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author WGH
 */
@RestController
@RequestMapping("/admin/hosp/department")
@Api(value = "DepartmentController",tags = "医院科室管理")
public class DepartmentController {

    @Resource
    private DepartmentService departmentService;

    /**
     * 根据医院编号，查询医院所有科室列表
     */
    @ApiOperation(value = "查询医院所有科室列表")
    @GetMapping("/getDeptList")
    public Result getDeptList(@RequestParam String hoscode) {
        List<DepartmentVo> list = departmentService.findDeptTree(hoscode);
        return new Result(list);
    }
}